﻿@model S4Store.Models.Markting.JKXGHistoryModel
@{
    ViewBag.Title = "JKXGHistory";
}
@{
    Layout = null;
    ViewBag.Title = "YDJKXGHistory";

        S4Store.Models.Chart.Line ChartModel1 = new S4Store.Models.Chart.Line();
        ChartModel1.Name =Model.Media.Name+"获取信息数";
        ChartModel1.YAxis = "数量";
        ChartModel1.IsRate = false;
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel1.XAxis.Add(dt.ToString("M月"));
        }
        S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "获取信息目标";
        S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
        series2.Name = "获取信息数量";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month );
            series1.Data.Add(report.HQXXMB);
            series2.Data.Add(report.HQXXS);
        }
        ChartModel1.Serieses.Add(series1);
        ChartModel1.Serieses.Add(series2);


        S4Store.Models.Chart.Line ChartModel2 = new S4Store.Models.Chart.Line();
        ChartModel2.Name = Model.Media.Name + "单击退出率/休眠账户比";
        ChartModel2.YAxis = "退出率(%)";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel2.XAxis.Add(dt.ToString("M月"));
        }
        series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "目标单击退出率/休眠账户比";
        
        series2 = new S4Store.Models.Chart.ChartSeries();
        series2.Name = "实际单击退出率/休眠账户比";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
            series1.Data.Add(report.NetMarketingStandard.GZTCLV);
            series2.Data.Add(report.DJTCLV);
        }
        ChartModel2.Serieses.Add(series1);
        ChartModel2.Serieses.Add(series2);




        S4Store.Models.Chart.Line ChartModel3 = new S4Store.Models.Chart.Line();
        ChartModel3.Name = Model.Media.Name + "下线转化率";
        ChartModel3.YAxis = "转化率(%)";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel3.XAxis.Add(dt.ToString("M月"));
        }
        series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "目标转化率";
        series2 = new S4Store.Models.Chart.ChartSeries();
        series2.Name = "实际转化率";
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
            series1.Data.Add(report.NetMarketingStandard.XXZHLV);
            series2.Data.Add(report.XXZHLV);
        }
        ChartModel3.Serieses.Add(series1);
        ChartModel3.Serieses.Add(series2);

        
        S4Store.Models.Chart.Line ChartModel4 = new S4Store.Models.Chart.Line();
        ChartModel4.Name = Model.Media.Name + "单组资源成本";
        ChartModel4.YAxis = "万元";
        ChartModel4.IsRate = false;
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            ChartModel4.XAxis.Add(dt.ToString("M月"));
        }
        series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "网站平均单组资源成本";
        series1.Precision = 4;
        series2 = new S4Store.Models.Chart.ChartSeries();
        series2.Name = "本站单组资源成本";
        series2.Precision = 4;
        for (DateTime dt = Model.Start; dt <= Model.End; dt = dt.AddMonths(1))
        {
            var report = Model.Reports.FirstOrDefault(t => t.Year == dt.Year && t.Month == dt.Month);
            series1.Data.Add(report.GroupReport.DZZYCB);
            series2.Data.Add(report.DZZYCB);
        }
        ChartModel4.Serieses.Add(series1);
        ChartModel4.Serieses.Add(series2);
}
<div style="height:100%; width:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div class="pageContent">
	
	<div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
                        <li><a href="javascript:;"><span>获取信息数</span></a></li>
                        <li><a href="javascript:;"><span>单击退出率/休眠账户比</span></a></li>
                        <li><a href="javascript:;"><span>下线转化率</span></a></li>      
                        <li><a href="javascript:;"><span>单组资源成本</span></a></li>                    			
				</ul>
			</div>
		</div>
		<div class="tabsContent" >
			<div>@Html.Partial("../Chart/Line", ChartModel1)</div>
			<div>@Html.Partial("../Chart/Line", ChartModel2)</div>
			<div>@Html.Partial("../Chart/Line", ChartModel3)</div>
			<div>@Html.Partial("../Chart/Line", ChartModel4)</div>           
		</div>
		<div class="tabsFooter">
			<div class="tabsFooterContent"></div>
		</div>
	</div>
</div>

</div>


